<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<div class="row">
	<div class="col-xs-12">
		<div class="btn-group m-b-1" role="group">
			<?php echo admin_tab_active($menu['pay']['tab'], 'bank');?>
		</div>
	</div>
</div>

<div class="row">
	<div class="col-lg-12">
		<div class="card">
			<div class="table-responsive">
				<form action="<?php echo url('pay-bank');?>" method="POST">
					<table class="table" style="min-width: 800px">
						<thead>
							<tr>
								<th class="text-center">名称</th>
								<th class="text-center">CODE</th>
								<th class="text-center">开关</th>
							</tr>
						</thead>
						<tbody id="userlist">
							<?php if($bank){foreach($bank as $l){ ?>
							<tr uid="<?php echo $l['id']; ?>">
								<td class="text-center"><input class="form-control" name="name[<?php echo $l['id'];?>]" value="<?php echo $l['name'];?>"></td>
								<td class="text-center"><input class="form-control" name="shortname[<?php echo $l['id'];?>]" value="<?php echo $l['shortname'];?>"></td>
								<td class="text-center">
									<select class="form-control" name="is_open[<?php echo $l['id'];?>]">
										<option value="1" <?php if($l['is_open']==1){echo 'selected';} ?>>开</option>
										<option value="0" <?php if($l['is_open']==0){echo 'selected';} ?>>关</option>
									</select>
								</td>
							</tr>
							<?php }} ?>
						</tbody>
					</table>
					<button class="btn btn-primary" id="submit" style="margin:5px 10px;">提交修改</butotn>
				</form>
			</div>
			<hr class="m-t-0" />
		</div>
		<nav class="text-center"><ul class="pagination"><?php echo $pagination; ?></ul></nav>
	</div>
</div>

<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>

<script>

var jform = $('form');
$('#submit').click(function(){
	var postdata = jform.serialize();
	$.xpost(jform.attr('action'), postdata, function(code, message){
		$.alert(message);
		if(code==1) setTimeout(function(){window.location.reload()}, 1500);
	});
	return false;
});

$('#nav_pc li.pay, #nav_mobile li.pay').tab('show');
</script>